Quote {build.source.path} to allow spaces in path #4868
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously sketches or examples that had spaces anywhere in their absolute path caused a total build failure. By adding quotes around the path in
platform.txt
, they now build correctly.Consider a “bare minimum” sketch in
/home/pieter/Arduino/folder with spaces/Sketch/Sketch.ino
. Previously, the bash command generated for copying thepartitions.csv
file was:With the proposed changes, the path in the bash command is now correctly quoted, and the build succeeds:
bash -c "[ ! -f \"/home/pieter/Arduino/folder with spaces/Sketch\"/partitions.csv ] || cp -f \"/home/pieter/Arduino/folder with spaces/Sketch\"/partitions.csv /tmp/arduino_build_324565/partitions.csv"
This pull request addresses issues #4579 and #4640.
People use spaces in folder names, and this works correctly in version 1.0.4 of this ESP32 core and all other Arduino cores I've tried. It no longer works in version 1.0.5 (after commit 9ef3e2d), so I believe this is well worth fixing, especially since it's such a simple change.